package com.apop.common.controller;

import com.apop.common.enums.ErrorCode;
import com.apop.common.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 登陆鉴权
 * @ClassName AuthController
 * @Author Jiayi Zheng
 * @Date 2021/12/27 15:41
 * @Description: todo
 * @Version V1.0
 */
@RestController
@Slf4j
public class OldAuthController {

    @PostMapping("/auths/login")
    public Object login(HttpServletRequest request, String username, String password, String tryCode) {

        log.debug("用户名 {} 密码 {} ",username,password);
        if( "admin".equals(username)){
            return Result.success("ok");
        }else{
            return Result.fail(ErrorCode.EXCEPTION_INCORRECT_USERNAME_OR_PASSWORD);
        }

    }


}
